import sys
sys.path.append('pp')
import pp

def runProcess(cmd):
  split_cmd = cmd.split(' ')
#  split_cmd = ['python', '-c', 'import numpy; print numpy.version.version']
  import subprocess
  a = subprocess.check_output(split_cmd)
  return a.strip(" \n\r\t")

nb_cpu = 3
servers_ok = ('*',) 

cmd = '/home/personnels/brixtel/SVN/parpyn/externalProgram.py 1'

job_server = pp.Server(nb_cpu, servers_ok)
job = job_server.submit(runProcess, (cmd,))
res = job()
print res

